home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextLibrary / Frameworks / NEXTIME.framework / Versions / A / Headers / NTMovieScreenCell.h < prev    next >
Encoding:
Text File  |  1996-01-16  |  3.0 KB  |  101 lines

  1. /*
  2.  * NTMovieScreenCell - subclass of NSActionCell that displays movies
  3.  *     target/action messages are sent and usually used to start/stop
  4.  *        playback.  The state of a NTVideoCell indicates its playback
  5.  *        state: 0 - not playing (stopped, paused), 1 - playing
  6.  */
  7.  
  8. #import <AppKit/NSActionCell.h>
  9. #import <AppKit/NSTextAttachment.h>
  10.  
  11. /* XXX: probably doesn't have to inherit from NSActionCell but something broke
  12.  * with the controlView setting when it was a NSCell.
  13.  */
  14.  
  15. typedef enum _NTVideoCellSizing
  16. {
  17.     NTMovieScreenCellNormalSizing = 0,                /* no resizing */
  18.     NTMovieScreenCellPowerOfTwoSizing,            /* double or halve to fit (preserves aspect) */
  19.     NTMovieScreenCellContinuousSizing,                 /* size to fit (does not preserve aspect) */
  20.     NTMovieScreenCellMaintainAspectRatioSizing     /* largest size that maintains aspect ratio */
  21. } NTMovieScreenCellSizing;
  22.  
  23. @class NSWindow;
  24. @class NSScreen;
  25.  
  26. @interface NTMovieScreenCell : NSActionCell <NSTextAttachmentCell>
  27. {
  28. @private
  29.     id _attachment;
  30.     NSRect _frame;        /* cached frame and clip frame used to keep the server in sync */
  31.     NSRect _clippedFrame;
  32.     NSRect _displayRect;        /* the actual rect we're displaying in (window coords) */
  33.     NSSize _movieSize;        /* the "natural" size of the movie */
  34.     id _displayContext;
  35.     NTMovieScreenCellSizing _resizeMode;     /* how do we resize */
  36.     int _backingStoreType;        /* Window backing store type */
  37.     NSWindow * _window;    /* cached window and screen used only to keep the server in sync */
  38.     NSScreen * _screen;
  39.     BOOL _gstateIsInvalid;
  40.     void *    _private;
  41. }
  42. /*
  43.  * Designated initializer.  This class overrides initImageCell: and
  44.  * initTextCell: and invokes our init method.
  45.  */
  46. - (id)init;
  47. /*
  48.  * Set our type to NSNullCellType
  49.  */
  50.  
  51. - (NTMovieScreenCellSizing)resizeMode;
  52. - (void)setResizeMode:(NTMovieScreenCellSizing)mode;
  53.  
  54.  
  55. - (void)setRepresentedObject:(id)anObject;
  56. /*
  57.  * Used to associate the reciever with an instance of the NTMediaDocument class.
  58.  * The receiver registers the method 'mediaControllerSaid:' for all notifications 
  59.  * issued by "anObject", retrieves the natural size of the movie represented by
  60.  * "anObject" and sends the message 'suspendDrawing' to "anObject".
  61.  */
  62.  
  63. /*** drawing changes ***/
  64.  
  65. - (void)updateFrame:(NSRect)frame;
  66. /*
  67.  * Check to see if 'frame' is the same as the frame
  68.  * we last sent to the NTMediaController.  If it isn't
  69.  * transmit the new information.  Override this to implement
  70.  * hardware driven display updates, such as refreshing a display from
  71.  * an MPEG card.
  72.  */
  73.  
  74. - (void)setNewView:(NSView *)aView;
  75. /*
  76.  * Called when we are asked to draw in a new NSView.
  77.  * Transmit the change to our NTSimpleMediaControl and
  78.  * Register to receive gState invalidations for the new view.
  79.  * Passing aView of nil decouples the cell from any view, suspending
  80.  * video display.
  81.  */
  82.  
  83. /*** event processing methods ***/
  84.  
  85. - (BOOL)wantsToTrackMouse;
  86. /*
  87.  * Returns 'YES'
  88.  */
  89.  
  90. - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame
  91.     ofView:(NSView *)controlView untilMouseUp:(BOOL)flag;
  92.  
  93. /*** text attachment support ***/
  94.  
  95. - (void)setAttachment:(NSTextAttachment *)anObject;
  96. - (NSTextAttachment *)attachment;
  97.  
  98. @end
  99.  
  100.  
  101.